import packageJson from '../package.json';

const { name, version, config } = packageJson;

export default {
  code: name,
  version,
  width: config.width,
  height: config.height,
  config: [
    {
      name: '子组件管理',
      code: 'mapSelect',
      type: 'MapSelect',
      value: '',
      enumValue: [],
    },
    {
      name: '地图基础配置',
      code: 'base',
      children: [
        {
          name: '中心点经度(-180~180)',
          code: 'lng',
          value: 104,
          step: 0.1,
          max: 180,
          min: -180,
          type: 'InputNumber',
        },
        {
          name: '中心点纬度(-90~90)',
          code: 'lat',
          value: 39.65,
          step: 0.1,
          max: 90,
          min: -90,
          type: 'InputNumber',
        },
        {
          name: '默认缩放比例(3~19)',
          code: 'zoom',
          value: 5,
          max: 19,
          min: 3,
          type: 'InputNumber',
        },
        {
          name: '最小缩放比例(3~19) ',
          code: 'minZoom',
          value: 3,
          max: 19,
          min: 3,
          type: 'InputNumber',
        },
        {
          name: '最大缩放比例(3~19) ',
          code: 'maxZoom',
          value: 19,
          max: 19,
          min: 3,
          type: 'InputNumber',
        },
        {
          name: '开启拖拽',
          code: 'dragable',
          value: true,
          type: 'CheckBox',
        },
        {
          name: '开启缩放',
          code: 'zoomable',
          value: true,
          type: 'CheckBox',
        },
      ],
    },
  ],
  data: {
    field: [
      { name: 'lng', mapper: 'lng' },
      { name: 'lat', mapper: 'lat' },
      { name: 'zoom', mapper: 'zoom' },
    ],
    type: 1,
    value: JSON.stringify([{ lat: '', lng: '', zoom: '' }]),
  },
  events: {
    click: {
      description: '标签点击响应事件',
      fields: {
        slatitude: {
          mapper: '',
          description: '默认中心点纬度',
          // value: 34.115200235165396
        },
        slongitude: {
          mapper: '',
          description: '默认中心点经度',
          // value: 117.85100206054689
        },
        level: {
          mapper: '',
          description: '地图默认缩放等级',
          // value: 12
        },
      },
      action: {
        active: false,
      },
    },
  },
  seriesDefault: [],
  series: [],
  name: '地图组',
  coordinate: { y: 0, x: 0 },
  // 新建地图时默认的子组件
  defaultComp: [
    { code: 'custom_map_group_base' },
    // { code: 'custom_map_group_geoheat' },
    // { code: 'custom_map_group_bubble' },
    // { code: 'custom_map_group_flyline' },
    { code: 'custom_map_group_marker' },
  ],
};
